#ifndef RIGIDBODY_H
#define RIGIDBODY_H

#include "PhysicsCalculations.h"
#include "RBTYPE.h"

#include <D3D11.h>
#include <D3DX10math.h>

class RigidBody2
{
public:
	RigidBody2();

	virtual void Draw() = 0;
	virtual void Update() = 0;
	const RBTYPE GetType() const;

	void operator=(const RigidBody2& rh);
	
	const float GetMass() const;
	void SetMass(float mass);

	const D3DXVECTOR3& GetPosition() const;
	void SetPosition(const D3DXVECTOR3& position);

	const D3DXVECTOR3& GetAccleration() const;
	void SetAcceleration(const D3DXVECTOR3& acceleration);

	const D3DXVECTOR3& GetVelocity() const;
	void SetVelocity(const D3DXVECTOR3& velocity);

	const D3DXVECTOR3& GetOldVelocity() const;
	void SetOldVelocity(const D3DXVECTOR3& oldVelocity);

	const D3DXVECTOR3& GetForce() const;
	void SetForce(const D3DXVECTOR3& force);
	void AddForce(const D3DXVECTOR3& force);

	const float GetRotation() const;
	void SetRotation(float rotation);

	const float GetRotationalVelocity() const;
	void SetRotationalVelocity(float velocity);

	const float GetRotationalAcceleration() const;
	void SetRotationalAccleration(float acceleration);

	const float GetTorque() const;
	void SetTorque(float torque);

	const float GetMoment() const;
	void SetMoment(float moment);

protected:
// linear movements
	float m_mass;
	float m_inverseMass;
	D3DXVECTOR3 m_position; // centre of mass
	D3DXVECTOR3 m_oldPosition;
	D3DXVECTOR3 m_acceleration;
	D3DXVECTOR3 m_velocity;
	D3DXVECTOR3 m_oldVelocity;
	D3DXVECTOR3 m_force;
// rotation movements
	float m_rotVelocity;
	float m_rotAcceleration;
	float m_rotation;
	float m_torque;
	float m_moment; // change for a body scalar

	POSCALCULATION m_posCalc;
	RBTYPE m_rbType;

	//float m_radius;
};

#endif //RIGIDBODY_H